package org.example.test;

import org.junit.Test;
import singleton.SingletonTest01;
import singleton.SingletonTest02;
import singleton.thread.MyThread01;


public class Mytest01 {


    @Test
    public void test01(){

        SingletonTest01 instance1 = SingletonTest01.getInstance();
        SingletonTest01 instance2 = SingletonTest01.getInstance();
        System.out.println(instance1 == instance2);
        System.out.println(instance1.hashCode());
        System.out.println(instance2.hashCode());

    }

    @Test
    public void test02() throws Throwable {

        MyThread01 myThread01 = new MyThread01();
        MyThread01 myThread02 = new MyThread01();
        Thread t = new Thread(myThread01);
        Thread t1 = new Thread(myThread02);
        t.start();
        t1.start();

    }


}
